package practice08;

public class Person {
    private int id;
    private String name;
    private int age;

    public Person(int id, String name, int age) {
        this.id = id;
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public int getAge() {
        return age;
    }
    public int getId() {
        return id;
    }
    public boolean equals(Object o){
        if (this == o){
            return true;
        }
        if ((o == null) || !getClass().equals(o.getClass() )){
            return false;
        }
        Person person = (Person) o;
        return age == person.age && id == person.id && name == person.name;
    }
    public int hashcode(){
        return id;
    }
    public String introduce() {
        return "My name is "+ name +". I am "+ age +" years old.";
    }
}
